[RFC][WIP] zephyr: extract heap management#4483
[RFC][WIP] zephyr: extract heap management#4483lyakh wants to merge 2 commits intothesofproject:mainfrom
Conversation
Create alloc.c for all heap management code. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
IMX and cAVS have different heap configurations, split the file to eliminate ifdefs. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
| static uint8_t __aligned(PLATFORM_DCACHE_ALIGN)heapmem[HEAPMEM_SIZE]; | ||
| static uint8_t __aligned(PLATFORM_DCACHE_ALIGN)heapmem_shared[HEAPMEM_SHARED_SIZE]; | ||
| #endif | ||
|
|
There was a problem hiding this comment.
@lyakh I don't think we should split this into 2 files, for imx and cavs - there is a lot of duplicated code.
I was thinking of keeping the #ifdef CONFIG_IMX at line 34, since we, for imx, need the heapmem variable in a different section.
The next part, the #else (starting with line 41) I believe it should be split into SMP and non-SMP.
For imx we only need non-SMP, APL has also 1 core, so there is no need for heapmem and heapmem_shared or sof_heap and sof_heap_shared- no need to split heap into shared and unshared.
The shared variables should be declared only for SMP. Please, correct me if I'm wrong.
I've tested only with sof_heap on imx and also @marc-hb verified on APL - see comment here.
In the rest of the file, where we use sof_heap_shared, should be under #ifdef CONFIG_SMP - in functions like statics_init(), rmalloc(), rfree().
Agreed right now there's way too much duplication, copy/paste/diverge is unmaintainable. The |
A draft for IMX / cAVS splitting. In fact the difference is very small, maybe we can keep a large portion of this common. This is just a quick RFC, suggestions?